package main
import "fmt"
func main(){
	var num int = 72
	var str string = "Hello"
	
	fx := func(){
		fmt.Printf("函数1 : num = %d\tstr = %s\n", num, str)
	}
	fx()
	
	defer func(){
		fmt.Printf("函数2 : num = %d\tstr = %s\n", num, str)
	}()
	
	/*注意，是在这里修改了num 和 str 的值*/
	
	
	defer func(num int, str string){
		fmt.Printf("函数3 : num = %d\tstr = %s\n", num, str)
	}(num, str)
	
	num = 101
	str = "你好"
	
	defer func(){
		fmt.Printf("函数4 : num = %d\tstr = %s\n", num, str)
	}()
	
	/*注意，是在这里修改了num 和 str 的值*/
	num = 108
	str = "我很好"
	
}
